package cn.zfgc.jfinal.controller.BaseController;

import cn.zfgc.jfinal.core.Controller;
import cn.zfgc.jfinal.core.WebSocketController;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import javax.servlet.ServletContext;
import javax.websocket.Session;

/**
 * Created by wangwang on 2017/3/6 0006.
 */
public class BaseController extends WebSocketController {
    public final static WebApplicationContext webApplicationContext = ContextLoader.getCurrentWebApplicationContext();

    public final static ServletContext servletContext = webApplicationContext.getServletContext();

    public final static ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);

    @Override
    public void onOpen(Session session) {

    }

    @Override
    public void onClose(Session session) {

    }
}
